<template>
	<view class="thumb-box" :class="mode?'show':''" v-for="(items, indexs) in list" :key="indexs"
		@click="multiRedirect('/subpkg/comditydetails/comditydetails?id=' + items.id)">
		<view class="thumb-left">
			<u-image radius="15" :src="items.cover_img" width="100%" :height="mode?'230rpx':'180rpx'"></u-image>
		</view>
		<view class="thumb-right" :class="mode?'show':''">
			<view class="thumb-up">
				<view class="thumb-name u-line-1">{{items.name}}</view>
				<view class="thumb-pacie">{{items.price}}</view>
			</view>
			<view class="thumb-bottm">
				<view class="thumb-num">{{items.sold_num}}件已售</view>
				<button class="cu-btn thumb-buttom" @click.stop="$emit('skuChang',items)">选规格</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "commodity-item",
		props: {
			list: {
				type: Array,
				default: (() => {
					return []
				})
			},
			mode: {
				type: String,
				default: ''
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	@import "@/static/css/home.scss";
</style>
